#include<iostream>
#include<unistd.h>
using namespace std;

int main()
{
  pid_t ret = fork();
  
  if(ret==0)
  {
    while(1)
    {
      cout<<"I am child  "<< getpid() <<"  "<<getppid()<<endl;
      sleep(1);
    }
  }
  else if(ret > 0)
  {
    while(1)
    {
      cout<<"I am father  "<< getpid()<<"  "<<getppid() <<endl;
      sleep(1);
    }
  }
  else
  {
    ;
  }





//  while(1)
//  {
//    cout<<"hello"<<endl;
//    sleep(1);
//  }
  return 0;
}
